from django.db import models

# Create your models here.


class BaseModel(models.Model):
	created_at = models.DateTimeField(auto_now_add=True)
	class Meta:
		abstract = True

class Author(BaseModel):
    email = models.EmailField(max_length=100)
    name = models.CharField(max_length=100)
    password = models.CharField(max_length=100)


class Entry(BaseModel):
    author = models.ForeignKey(Author)
    slug = models.SlugField(max_length=1024)
    title = models.CharField(max_length=1024)
    input_content = models.TextField()
    input_format = models.CharField(max_length=255, default='markdown')
    display_content = models.TextField()
    updated_at = models.DateTimeField(auto_now_add=True)
